<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <input v-model="num" type="text"/>
        <button v-on:click="num++">点赞</button>
        <button v-on:click="cancel">取消点赞</button>
        <h3>{{name}}，非常帅，有{{num}}个人为他点赞</h3>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>

    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                name:"张三",
                num:0
            },
            methods:{
                cancel(){
                    this.num--;
                }
            }
        });
    </script>
</body>

</html>